mkdir -p processed  # Ensure the processed directory exists

for f in ./*.*; do
    filename=$(basename "$f")
    # Process the file with ffmpeg
    avifenc -q 30 "$f" "processed/${filename}.avif"
    # Get the modification time of the original file
    original_mod_time=$(stat -c %y "$f")

    # Apply the modification time to the processed file
    touch -m -d "$original_mod_time" "processed/${filename}.avif"
done


for f in processed/*.*; done
    mv "processed/${filename}.avif" "processed/${filename}.jpg"     
done
